package com.liu.service.impl;

import com.liu.dao.TAdminLogDao;
import com.liu.entity.TAdminLog;
import com.liu.service.TAdminLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 后台管理员登录日志表(TAdminLog)表服务实现类
 *
 * @author makejava
 * @since 2022-11-04 17:48:44
 */
@Service("tAdminLogService")
public class TAdminLogServiceImpl implements TAdminLogService {
    @Autowired
    private TAdminLogDao tAdminLogDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public TAdminLog queryById(Long id) {
        return this.tAdminLogDao.queryById(id);
    }



    /**
     * 新增数据
     *
     * @param tAdminLog 实例对象
     * @return 实例对象
     */
    @Override
    public TAdminLog insert(TAdminLog tAdminLog) {
        this.tAdminLogDao.insert(tAdminLog);
        return tAdminLog;
    }

    /**
     * 修改数据
     *
     * @param tAdminLog 实例对象
     * @return 实例对象
     */
    @Override
    public TAdminLog update(TAdminLog tAdminLog) {
        this.tAdminLogDao.update(tAdminLog);
        return this.queryById(tAdminLog.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.tAdminLogDao.deleteById(id) > 0;
    }
}
